package cn.ljx.Controller;

import cn.ljx.Service.UserService;
import cn.ljx.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

/**
 * Created by dell on 2019/1/8.
 */
@Controller
public class add {
    @Resource
    private UserService userService;


    @RequestMapping("/tz")

    public String tz(){
        return "add";
    }
    @RequestMapping("/add")
    public String add(
                                    User user, Model model)
    {
        int a=userService.addUser(user);
if(a>0){

    return "index";

}
        return "add";
    }
}